Skip to content

Conversation

@bigbes
Copy link
Collaborator

@bigbes bigbes commented Oct 16, 2025

  • New Tarantool Config Storage (TCS) driver package (driver/tcs).
  • Integration testing for TCS
  • Updated .golangci.yml to fix needed packages and modify default testing rules.
  • Modified core driver interfaces to be compatible with tcs.
  • Update go module dependencies.

Closes #TNTP-4188

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Introduce a new Tarantool TKV driver and align core interfaces and models to support it

  • Add TKV driver with transactional execution and key watch support
  • Adjust driver interfaces (Watch signature) and data models (KeyValue, RequestResponse) for compatibility
  • Add integration tests against a Tarantool instance and update dependencies and lint configuration

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
driver/tkv/tkv.go Implements TKV driver Execute and Watch, wiring to Tarantool watcher API.
driver/tkv/txn.go Defines request/response encoding/decoding and maps Tarantool responses to tx.Response.
driver/tkv/operations.go Encodes operations (get/put/delete) for TKV.
driver/tkv/predicate.go Encodes predicates and maps ops/targets to TKV equivalents.
driver/tkv/integration_test.go Integration tests validating put/get/delete, predicates, multi-op, and watch behavior.
driver/driver.go Changes Watch API to return a channel, a stop function, and an error.
driver/etcd/etcd.go Updates Watch signature to match the new Driver interface.
watch/event.go Simplifies Event to contain only Prefix.
tx/requestresponse.go Refactors RequestResponse to hold a slice of KeyValue values.
kv/kv.go Removes CreateRevision and Version fields; keeps ModRevision.
internal/mocks/driver_mock.go Updates mocks to match the new Watch signature.
go.mod Adds msgpack/v5 as a direct dependency.
.golangci.yml Allows msgpack imports and tarantool packages in tests.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch from 7531a92 to c5c3cb7 Compare October 16, 2025 12:48
@bigbes bigbes requested a review from Copilot October 16, 2025 12:48
@coveralls
Copy link

coveralls commented Oct 16, 2025

Pull Request Test Coverage Report for Build 18777587711

Details

  • 182 of 966 (18.84%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.8%) to 21.09%

Changes Missing Coverage Covered Lines Changed/Added Lines %
driver/etcd/etcd.go 0 1 0.0%
driver/tcs/txn.go 31 35 88.57%
internal/mocks/driver_mock.go 0 8 0.0%
driver/tcs/predicate.go 34 44 77.27%
internal/testing/t.go 0 14 0.0%
driver/tcs/operations.go 31 47 65.96%
internal/testing/request.go 0 24 0.0%
internal/testing/response.go 0 40 0.0%
internal/testing/doerwithwatcher.go 0 44 0.0%
internal/testing/doer.go 0 47 0.0%
Totals Coverage Status
Change from base Build 18098700518: -0.8%
Covered Lines: 360
Relevant Lines: 1707

💛 - Coveralls

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return rvChan, func() { close(isStopped) }, nil
}
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returned stop function will panic if called more than once due to closing the same channel twice. Make it idempotent, e.g., by wrapping the close with a sync.Once or an atomic guard.

Copilot uses AI. Check for mistakes.

@bigbes bigbes added the full-ci label Oct 16, 2025
@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch 2 times, most recently from 870c579 to 2df1217 Compare October 16, 2025 15:43
@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch from 2df1217 to 2c88b0b Compare October 16, 2025 15:51
@bigbes bigbes added full-ci and removed full-ci labels Oct 16, 2025
@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch from 2c88b0b to 1d5d4ed Compare October 16, 2025 16:15
Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, rename TKV -> TcS or TCS everywhere.

Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, update the CI impl commit title & message.

Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a nice idea to start the CHANGELOG.md here. Or you could it fill on the first release. Up to you.


env:
# Note: Use exactly match version of tool, to avoid unexpected issues with test on CI.
GO_VERSION: '1.23.8'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the library requires 1.24 in the go.mod.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment on lines 37 to 53
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '${{ env.PYTHON_VERSION }}'

- name: Setup Mage
run: |
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
shell: bash

- name: Install build requirements
run: |
sudo apt -y update
sudo apt -y install git gcc make cmake unzip zip fish zsh
shell: bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the stuff here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

tar -xzf ${ARCHIVE_NAME}
rm -f ${ARCHIVE_NAME}
source tarantool-enterprise/env.sh
shell: bash No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a newline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 32 to 35
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '${{ env.GO_VERSION }}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we don't need the Go here. It is better to install the Go in a job pipeline directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

${INSTALL_PREFIX}/etcd --version
${INSTALL_PREFIX}/etcdctl version 2>/dev/null || ${INSTALL_PREFIX}/etcdctl --version
echo "ETCD_PATH=$(echo $INSTALL_PREFIX)" >> "$GITHUB_ENV"
echo "${INSTALL_PREFIX}" >> "$GITHUB_PATH" No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a newline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment on lines 35 to 36
// FailedToEncodeTkvPredicateError is returned when we failed to encode tkvPredicate.
type FailedToEncodeTkvPredicateError struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same about the too long naming.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 25 to 26
// skipIfNoTarantool skips the test if no Tarantool instance is available.
func skipIfNoTarantool(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need skip tests with TCS in case of Tarantool CE.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Watch(ctx context.Context, key []byte, opts ...watch.Option) <-chan watch.Event
// The returned cleanup function should be called to stop the watch and release resources.
// An error is returned if the watch could not be established.
Watch(ctx context.Context, key []byte, opts ...watch.Option) (<-chan watch.Event, func(), error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a tests that the TCS driver implements the Driver interface.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used, instead:

_ driver.Driver = &Driver{} //nolint:exhaustruct

@@ -0,0 +1,771 @@
package tkv_test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There are a lack of negative tests. At least without a successful connect.
  2. Too complex nagative scenarios should be tested with unit-tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. added test for unsuccesfull connect (== no rw instance in pool
  2. 👍

Comment on lines 40 to 42
// New creates a new Tarantool driver instance.
// It establishes connections to Tarantool instances using the provided addresses.
func New(doer DoerWatcher) *Driver {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add two examples of usage the driver: Execute & Watcher.

The examples could be added into a root directory of the project to example_test.go (I prefer the way).
Or in the package.

Up to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch 8 times, most recently from 5414399 to bdd88e7 Compare October 24, 2025 10:35
@bigbes bigbes requested a review from oleg-jukovec October 24, 2025 10:36
@bigbes bigbes requested a review from Copilot October 24, 2025 10:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch from bdd88e7 to 3d42b92 Compare October 24, 2025 10:38
@bigbes bigbes requested a review from Copilot October 24, 2025 10:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch 2 times, most recently from 16fb273 to 1b7f28b Compare October 24, 2025 10:49
@bigbes bigbes requested a review from Copilot October 24, 2025 10:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- New Tarantool Config Storage (TCS) driver package (driver/tcs).
- Integration testing for TCS.
- Updated .golangci.yml.
- Modified core driver interfaces to be compatible with tcs.
- Update go module dependencies.

Closes #TNTP-4188
@bigbes bigbes force-pushed the elhimov/tntp-4188-implement-tkv-driver branch from 1b7f28b to e2cc7fa Compare October 24, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants